Repository navigation
fix(commit): refuse commit checks and commits while a commit confirmed is pending (#632) - #635
Merged
Merged
Conversation
…d is pending (#632) On Junos a commit check or commit made while a commit confirmed is pending confirms it silently: no new entry, no rollback. commit_check_config, load_and_commit_config, render_and_apply_j2_template, rollback_config and apply_junos_change_set now read `show system commit` under the candidate lock, before loading anything, and refuse with commit_confirmed_active. Dry runs, which never commit-check, are not guarded, and neither is the confirm path. UpgradeCommitConfirmedActive becomes CommitConfirmedActive; its code and message are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aging The coordinator stringifies stage errors and apply_change_set_with_cancel rebuilt only PlaneManagedConfig, so the change-set path's new CommitConfirmedActive surfaced as Validation and was audited as invalid_input. The plane_refusal side channel becomes stage_refusal and carries both refusals; the e2e tests now pin the audit error_kind for commit_check_config and apply_junos_change_set. (#632) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fastrevmd-lab
force-pushed
the
fix/pending-confirm-guard
branch
from
November 11, 2026 05:33
748542d to
7867fcb
Compare
This was referenced Nov 11, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Junos, a
commit checkor acommitmade while acommit confirmedis pending silently confirms it. No new entry is written and no rollback happens (verified on a lab vSRX, evidence in #632). Five tools run a commit check or commit with no check for that, so a "validate only" call could cancel another session's safety rollback:commit_check_configload_and_commit_configrender_and_apply_j2_templaterollback_configapply_junos_change_setThey now refuse with
commit_confirmed_activewhile a commit confirmed is pending. This is part 2 of #632. Part 3 (settled entries read as pending) is #634.Changes
candidate_transaction.rs):primary_operationreadsshow system commitunder the candidate lock, before loading anything. Ifcommit_confirm_pending(fix(upgrade_junos): detect a pending commit confirmed fromrollback pending(#632) #633) says entry 0 is pending, it refuses, and the existing cleanup reverts and unlocks.DryRunis guarded.DryRunnever commit-checks.CandidateBackendimpl moves fromConfigManager(which has no CLI) torustez::Device. Each method takes aConfigManagerper call; it is a stateless view, and the private-database flag lives onDevice.junos_transaction.rsstage()):revert_and_release.confirm_commit,confirm_junos_change_set) is not guarded, because confirming a pending commit is its job.PlaneManagedConfigwas rebuilt.plane_refusalside channel becomesstage_refusaland carries both refusals, so the change-set path auditserror_kind=commit_confirmed_activelike the direct tools.UpgradeCommitConfirmedActivebecomesCommitConfirmedActive. Its code (commit_confirmed_active) and message are unchanged.docs/REFERENCE.mdno longer tells callers that anotherload_and_commit_configorrollback_configconfirms a window. It says they refuse, and namesconfirm_junos_change_setandconfirm_commit. There's also a new CHANGELOG bullet.Verification
The new tests:
DryRunis not blocked, and a settled log lets a commit check through.commit_check_configandapply_junos_change_setrefuse. No validate or commit RPC reaches the device, and the auditerror_kindiscommit_confirmed_activefor both.I broke the code four ways, one at a time, and each time only the intended tests failed:
pending_commit_confirmed_refuses_every_committing_mode,commit_check_is_refused_while_a_commit_confirmed_is_pendingstage()guard never refuseschangeset_apply_is_refused_while_a_commit_confirmed_is_pendingpending_commit_confirmed_does_not_block_dry_runchangeset_apply_is_refused_while_a_commit_confirmed_is_pending(audit kind)The Codex gate ran two rounds:
19ac927): one P2. The change-set refusal lost its type at the coordinator and was audited asinvalid_input. It's fixed in748542d, and the sabotage table's last row covers it.748542d): one P2, which I rejected. Codex asked to keep the removedtake_plane_refusalas an alias for SemVer, and the same argument would apply to the error-variant rename. Butrust-junosmcp-coreis not published: crates.io returns 404 and no workflow publishes it. Its only dependents are this workspace'srust-junosmcpandrust-junosmcp-srx-core, both updated here. The compatibility rule inAGENTS.mdcovers MCP schemas, scopes and audit behaviour, all of which are unchanged.Checklist
cargo fmt ... -- --checkpassescargo clippy ... -D warningspassescargo test --workspaceand the--no-default-featuresbuild passcargo audit/cargo deny check bans sources: not run, no dependency changesshow system commit) and a refusal before anything is loaded. Validation, the exact diff and confirmed commit with rollback are untouched. The refusal goes through the existing revert-and-unlock cleanup, and a failed read fails closed.PENDING_LOGfromcommit_attribution.rs(lab vSRX, 24.4R1.9), closed with</output>for the fake. It contains no hostname, serial or credential.Anything you're unsure about
rollback_configcan no longer end a pending window early by committingrollback 1.load_and_commit_configno longer confirms or extends a window.load_and_commit_configand the template tool.show system commitcannot be read, the candidate tools and change-set apply now fail instead of proceeding. A login class withoutviewpermission would break them.configure privatesessions.rollback pending(#632) #633). The guard placement is covered by the fake-device e2e tests.🤖 Generated with Claude Code